package p270jp.pxv.android.activity;

import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import p014ae.AbstractActivityC0122m4;
import p014ae.C0135p4;
import p014ae.View$OnClickListenerC0163u;
import p047bg.C1124a;
import p071cd.Functions;
import p134ei.AnalyticsScreenName;
import p134ei.PixivAnalytics;
import p187gl.PixivRequest;
import p210hh.PixivAccountManager;
import p270jp.pxv.android.R;
import p270jp.pxv.android.model.PixivWorkspace;
import p314lg.ActivityWorkspaceEditBinding;
import p325m0.MutabilityOwnership;
import p370ni.InfoType;
import p569vd.C6830b;
import p645yc.AndroidSchedulers;
import p671zc.CompositeDisposable;

/* compiled from: WorkspaceEditActivity.kt */
/* renamed from: jp.pxv.android.activity.WorkspaceEditActivity */
/* loaded from: classes2.dex */
public final class WorkspaceEditActivity extends AbstractActivityC0122m4 {

    /* renamed from: L */
    public static final /* synthetic */ int f18752L = 0;

    /* renamed from: I */
    public final CompositeDisposable f18753I = new CompositeDisposable();

    /* renamed from: J */
    public PixivWorkspace f18754J;

    /* renamed from: K */
    public ActivityWorkspaceEditBinding f18755K;

    /* renamed from: V0 */
    public final void m4680V0() {
        ActivityWorkspaceEditBinding k2Var = this.f18755K;
        if (k2Var != null) {
            k2Var.f21819u.m4595d(InfoType.LOADING, null);
            this.f18753I.mo82c(PixivRequest.m5805l(PixivAccountManager.m5511e().f16499e).m986o(AndroidSchedulers.m334a()).m984q(new C0135p4(this, 7), new C6830b(this, 7), Functions.f5386c, Functions.f5387d));
            return;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        ViewDataBinding d = DataBindingUtil.m11369d(this, R.layout.activity_workspace_edit);
        MutabilityOwnership.m3746l(d, "setContentView(this, R.l….activity_workspace_edit)");
        ActivityWorkspaceEditBinding k2Var = (ActivityWorkspaceEditBinding) d;
        this.f18755K = k2Var;
        C1124a.m10197Q(this, k2Var.f21813D, R.string.settings_workspace);
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6524f(AnalyticsScreenName.WORKSPACE_SETTINGS, null);
        p014ae.WorkspaceEditActivity q9Var = new p014ae.WorkspaceEditActivity(this);
        ActivityWorkspaceEditBinding k2Var2 = this.f18755K;
        if (k2Var2 != null) {
            k2Var2.f21823y.addTextChangedListener(q9Var);
            ActivityWorkspaceEditBinding k2Var3 = this.f18755K;
            if (k2Var3 != null) {
                k2Var3.f21820v.addTextChangedListener(q9Var);
                ActivityWorkspaceEditBinding k2Var4 = this.f18755K;
                if (k2Var4 != null) {
                    k2Var4.f21814E.addTextChangedListener(q9Var);
                    ActivityWorkspaceEditBinding k2Var5 = this.f18755K;
                    if (k2Var5 != null) {
                        k2Var5.f21811B.addTextChangedListener(q9Var);
                        ActivityWorkspaceEditBinding k2Var6 = this.f18755K;
                        if (k2Var6 != null) {
                            k2Var6.f21812C.addTextChangedListener(q9Var);
                            ActivityWorkspaceEditBinding k2Var7 = this.f18755K;
                            if (k2Var7 != null) {
                                k2Var7.f21821w.addTextChangedListener(q9Var);
                                ActivityWorkspaceEditBinding k2Var8 = this.f18755K;
                                if (k2Var8 != null) {
                                    k2Var8.f21824z.addTextChangedListener(q9Var);
                                    ActivityWorkspaceEditBinding k2Var9 = this.f18755K;
                                    if (k2Var9 != null) {
                                        k2Var9.f21818t.addTextChangedListener(q9Var);
                                        ActivityWorkspaceEditBinding k2Var10 = this.f18755K;
                                        if (k2Var10 != null) {
                                            k2Var10.f21822x.addTextChangedListener(q9Var);
                                            ActivityWorkspaceEditBinding k2Var11 = this.f18755K;
                                            if (k2Var11 != null) {
                                                k2Var11.f21817s.addTextChangedListener(q9Var);
                                                ActivityWorkspaceEditBinding k2Var12 = this.f18755K;
                                                if (k2Var12 != null) {
                                                    k2Var12.f21815q.addTextChangedListener(q9Var);
                                                    ActivityWorkspaceEditBinding k2Var13 = this.f18755K;
                                                    if (k2Var13 != null) {
                                                        k2Var13.f21816r.addTextChangedListener(q9Var);
                                                        m4680V0();
                                                        ActivityWorkspaceEditBinding k2Var14 = this.f18755K;
                                                        if (k2Var14 != null) {
                                                            k2Var14.f21810A.setOnClickListener(new View$OnClickListenerC0163u(this, 7));
                                                        } else {
                                                            MutabilityOwnership.m3737u("binding");
                                                            throw null;
                                                        }
                                                    } else {
                                                        MutabilityOwnership.m3737u("binding");
                                                        throw null;
                                                    }
                                                } else {
                                                    MutabilityOwnership.m3737u("binding");
                                                    throw null;
                                                }
                                            } else {
                                                MutabilityOwnership.m3737u("binding");
                                                throw null;
                                            }
                                        } else {
                                            MutabilityOwnership.m3737u("binding");
                                            throw null;
                                        }
                                    } else {
                                        MutabilityOwnership.m3737u("binding");
                                        throw null;
                                    }
                                } else {
                                    MutabilityOwnership.m3737u("binding");
                                    throw null;
                                }
                            } else {
                                MutabilityOwnership.m3737u("binding");
                                throw null;
                            }
                        } else {
                            MutabilityOwnership.m3737u("binding");
                            throw null;
                        }
                    } else {
                        MutabilityOwnership.m3737u("binding");
                        throw null;
                    }
                } else {
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
            } else {
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
        } else {
            MutabilityOwnership.m3737u("binding");
            throw null;
        }
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        this.f18753I.m80f();
        super.onDestroy();
    }

    @Override // androidx.activity.ComponentActivity, android.app.Activity
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        MutabilityOwnership.m3745m(menuItem, "item");
        if (menuItem.getItemId() != 16908332) {
            return super.onOptionsItemSelected(menuItem);
        }
        this.f940i.m12030b();
        return true;
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onPause() {
        View currentFocus = getCurrentFocus();
        if (currentFocus != null) {
            currentFocus.clearFocus();
        }
        super.onPause();
    }
}
